package com.junzhiit.nengji.shop.dao.impl;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.bainaeco.framework.base.dao.AbstractBaseDAO;
import com.bainaeco.framework.common.jdbc.StatementParameter;
import com.bainaeco.framework.enums.IsDelete;
import com.junzhiit.nengji.shop.dao.ChainGoodsImagesDAO;
import com.junzhiit.nengji.shop.model.ChainGoodsImages;

@Repository
public class ChainGoodsImagesDAOImpl extends AbstractBaseDAO<ChainGoodsImages> implements ChainGoodsImagesDAO{

	@Override
	public List<ChainGoodsImages> findByChainGoodsId(String chainGoodsId) {
		String sql = "select * from chain_goods_images where is_delete=? and chain_goods_id=? order by sort asc";

		StatementParameter param = new StatementParameter();
		param.setInt(IsDelete.NO.toIntValue());
		param.setString(chainGoodsId);

		return queryForList(sql, ChainGoodsImages.class, param);
	}


}
